package aimis.constant;

public enum ResponseEnum {

    /**
     * 2000 正常
     * 2001 通用错误
     * 3000 工作台
     * 3200 资产
     * 3400 告警事件
     * 3600 漏洞
     * 3800 用户
     * 4000 绩效
     * 4200 运营脚本
     * 4400 参数配置
     * 4600 工作流管理
     * 4800 报告中心
     */


    OK(2000, "操作成功"),

    /**
     * 用于直接显示提示用户的错误，内容由输入内容决定
     */
    SHOW_FAIL(2001, ""),

    /**
     * 方法参数没有校验，内容由输入内容决定
     */
    METHOD_ARGUMENT_NOT_VALID(2002, "数据校验失败"),

    /**
     * 无法读取获取请求参数
     */
    HTTP_MESSAGE_NOT_READABLE(2003, "请求参数格式有误"),

    /**
     * 未授权
     */
    UNAUTHORIZED(2004, "Unauthorized"),

    /**
     * 服务器出了点小差
     */
    EXCEPTION(2005, "服务器出了点小差"),

    /**
     * 数据异常
     */
    DATA_ERROR(2006, "数据异常，请刷新后重新操作"),

    /**
     * 一些需要登录的接口，而实际上因为前端无法知道token是否已过期，导致token已失效时，
     * 应该返回一个状态码，告诉前端token已经失效了，及时清理
     */
    CLEAN_TOKEN(2007, "clean token"),

    /**
     * 刷新token已过期
     */
    REFRESH_TOKEN_EXIST(2008, "refresh token exist"),

    /**
     * 数据不完整
     */
    DATA_INCOMPLETE(2009, "数据不完整"),

    DATA_NOT_EXIST(2010, "要进行操作的数据项或者关联的数据项不存在"),
    DATA_FOREIGN_KEY_CONSTRAINT(2011, "数据项被外键关联，无法删除"),
    GET_HOST_INFO_ERROR(2012, "获取主机信息失败"),
    SOFTWARE_NOT_REGISTER(2013, "软件未注册, 请先注册软件"),
    SN_INVALID_ERROR(2014, "序列号无效，请重试"),


    AFFECTED_NOT_EXIST(3600,"未关联受影响资产"),
    VULN_ALREADRY_EXIST(3601,"漏洞已存在"),
    RECORD_NOT_EXIST(3602,"对应处理记录不存在"),
    IGN_RULE_EXIST(3603,"漏洞忽略规则名称不能重复"),
    MER_RULE_EXIST(3604,"漏洞合并规则名称不能重复"),



    /**
     * 工作台部分
     */
    DUTYSCHEDULE_NOT_EXIST(3000,"该值班日历不存在"),
    DUTYSCHEDULE_EXIST(3001,"该日期已存在"),
    DUTYSCHEDULE_PERSON_EMPTY(3002,"请选择值班人员"),
    /**
     * 资产部分
     */
    PROPERTYGROUP_ALREADY_EXIST(3200,"组织已存在"),
    ROOT_PROPERTYGROUP_EDIT_PARENT(3201,"根资产组不能修改母资产组"),
    PARENT_ROOT_PROPERTYGROUP_ADD_TO_CHILD(3202,"母组织不能加入子组织当中"),
    //告警事件3400
    /*该告警存在待确认的资产，不能进行提报
    * */
    ALARM_REPORT_ERROR1(3400,"该告警存在待确认的资产，不能进行提报"),
    ALARM_REPORT_ERROR2(3401,"告警部门设置失败，不能进行提报"),
    ALARM_REPORT_ERROR3(3402,"告警状态不是新告警，不能进行提报"),
    ALARM_REPORT_ERROR4(3403,"事件分析提报失败"),

    UNCONFIRMEDPROPERTY_ALREADY_HANDLE(3203,"该待确认资产已被处理"),
    UNCONFIRMEDPROPERTY_NOT_ADDED_OR_MERGED(3204,"该资产状态不为新增或合并"),
    UNCONFIRMEDPROPERTY_PROPERTY_NOT_EXIST(3205,"未找到资产"),
    RESOUCE_NOT_EXIST(3203,"查询失败"),

    ALARM_MERGE_ERROR1(3404,"该告警存在待确认的资产，不能进行合并"),
    ALARM_MERGE_ERROR2(3405,"告警部门设置失败，不能进行合并"),
    ALARM_MERGE_ERROR3(3406,"事件合并失败"),
    ALARM_CLOSE_ERROR(3407,"事件关闭失败"),
    ALARM_MERGE_RULE_UPDATE_ERROR(3408,"更新失败"),
    ALARM_MERGE_RULE_CREATE_ERROR(3409,"创建失败"),
    ALARM_MERGE_RULE_DELETE_ERROR(3410,"删除失败"),
    EVENT_CHECK_ERROR_REPEATED(3411,"该事件已被抽检"),
    EVENT_CHECK_FAILED(3412,"事件抽检失败"),
    EVENT_TEMPLATE_DELETE_ERROR(3413,"删除失败"),
    EVENT_TEMPLATE_CREATE_ERROR(3414,"创建失败"),
    EVENT_TEMPLATE_UPDATE_ERROR(3415,"更新失败"),
    EVENT_TASK_RECEIVE_FAILED(3416,"请求失败"),
    EVENT_TASK_PROCESS_FAILED(3417,"请求失败"),
    EVENT_TASK_STAGE_FAILED(3418,"请求失败"),
    EVENT_TASK_SUBMIT_FAILED(3419,"请求失败"),
    EVENT_CLOSE_FAILED(3420,"事件关闭失败"),
    EVENT_TASK_CLOSE_FAILED(3421,"请求失败"),
    EVENT_TASK_HANDOVER_FAILED(3422,"请求失败"),
    EVENT_TASK_ASSIGN_FAILED(3423,"请求失败"),
    EVENT_ANALYSE_SUBMIT_FAILED(3424,"事件分析提交失败"),
    EVENT_MISRPORT_FAILED(3425,"事件判定失败"),
    EVENT_OPERATEION_REPORT_FAILED(3426,"事件处置提报失败"),
    EVENT_SHUT_ERROR(3427,"事件关闭失败"),
    EVENT_ADD_OPERATIONSYSTEM_FAILED(3428,"添加业务系统对象失败"),
    EVENT_DELETE_OPERATIONSYSTEM_FAILED(3429,"删除业务系统对象失败"),
    EVENT_ADD_RESOURCE_FAILED(3430,"添加基础资源对象失败"),
    EVENT_DELETE_RESOURCE_FAILED(3431,"删除基础资源对象失败"),
    EVENT_ADD_TERMINAL_FAILED(3432,"添加资产对象失败"),
    EVENT_DELETE_TERMINAL_FAILED(3433,"删除资产对象失败"),
    EVENT_ADD_SUSPECT_OBJECT_FAILED(3434,"添加可疑对象失败"),
    EVENT_DELETE_SUSPECT_OBJECT_FAILED(3435,"删除可疑对象失败"),
    EVENT_ADD_VULNERABILITY_FAILED(3436,"添加漏洞失败"),
    EVENT_DELETE_VULNERABILITY_FAILED(3437,"删除漏洞失败"),

    OS_NAME_CANNOT_BLANK(3206,"业务资产名称不能为空"),
    OS_PL_CANNOT_BLANK(3207,"业务资产等保级别不能为空"),
    OS_RD_CANNOT_BLANK(3208,"业务资产责任部门不能为空"),
    OS_RP_CANNOT_BLANK(3209,"业务资产责任人不能为空"),
    OS_URL_CANNOT_BLANK(3210,"业务资产公网地址不能为空"),
    OS_ALREADY_EXIST(3211,"业务资产名称已存在"),
    RES_NAME_CANNOT_BLANK(3212,"计算资源名称不能为空"),
    RES_MASTER_IP_CANNOT_BLANK(3213,"计算资源IP地址不能为空"),
    RES_ALREADY_EXIST(3214,"计算资源名称已存在"),
    RES_C_CANNOT_BLANK(3215,"计算资源机密性不能为空"),
    RES_I_CANNOT_BLANK(3216,"计算资源完整性不能为空"),
    RES_A_CANNOT_BLANK(3217,"计算资源可用性不能为空"),
    SYSTEM_UNIT_CANNOT_BLANK(3218,"系统单元不能为空"),
    SYSTEM_COMPONENT_CANNOT_BLANK(3219,"系统组件不能为空"),
    TER_NAME_CANNOT_BLANK(3220,"办公资源名称不能为空"),
    TER_IP_CANNOT_BLANK(3221,"办公资源IP地址不能为空"),
    TER_ALREADY_EXIST(3222,"办公资源名称已存在"),
    TER_C_CANNOT_BLANK(3223,"办公资源机密性不能为空"),
    TER_I_CANNOT_BLANK(3224,"办公资源完整性不能为空"),
    TER_A_CANNOT_BLANK(3225,"办公资源可用性不能为空"),
    TEMPLATE_NOT_EXIST(3226,"批量导入模板不存在"),







    LOGIN_FAIL(3800, "登录失败!用户名或者密码错误"),
    PASSWORD_NOT_MATCH(3801, "密码错误"),

    DEPARTMENT_REPEAT(3802, "部门重复"),
    /**
     * 工作流
     */
    WORKFLOWNODE_SET_ERROR(4600,"工作流节点设置错误"),

    /**
     * 工作流
     */
    REPORT_NAME_ALREADY_EXIST(4800,"报告模板名称不能重复"),

    ;




    private final Integer code;

    private final String msg;

    public Integer value() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    ResponseEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ResponseEnum{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + "} " + super.toString();
    }

}
